interface Shape{
    double calculateArea();
}
abstract class AbstractShape implements Shape{
    abstract double calculatePerimeter();
}
class Circle extends AbstractShape{
    private double r;
    public Circle(double r) {
        this.r = r;
    }
    public double calculateArea(){
        return 3.14*this.r*this.r;
    }
    public double calculatePerimeter(){
        return 2*3.14*this.r;
    }
}
class Square extends AbstractShape{
    private double edge;
    public Square(double edge){
        this.edge=edge;
    }
    public double calculateArea(){
        return this.edge*this.edge;
    }
    public double calculatePerimeter(){
        return 4*this.edge;
    }
}
public class Main {
    public static void main(String[] args) {
        Circle circle=new Circle(11);
        Square square=new Square(4);
        System.out.println(circle.calculateArea());
        System.out.println(circle.calculatePerimeter());
        System.out.println(square.calculateArea());
        System.out.println(square.calculatePerimeter());
    }
}